home *** CD-ROM | disk | FTP | other *** search
/ Pro One: Netcracker Netscape Navigator / ProOne: Netcracker Netscape Navigator.iso / pc / nc / nc_mm005.geo / 00070_SnakeLogic.ls < prev    next >
Encoding:
Text File  |  1997-03-19  |  7.2 KB  |  397 lines

  1. on InitSnakelogic
  2.   Set_SnakeSprite(3)
  3.   Set_HLSprite(4)
  4.   Set_TagSprite(40)
  5.   Set_TagIsShown(0)
  6.   Set_LastTag(0)
  7.   set the puppet of sprite Get_TagSprite() to 1
  8.   CreateSnakeGrid()
  9. end
  10.  
  11. on CreateSnakeGrid
  12.   Set_BoxSize(14)
  13.   SetGridRef()
  14. end
  15.  
  16. on CheckSnakeStatus
  17.   if rollOver(Get_SnakeSprite()) then
  18.     ShowTag()
  19.   else
  20.     if get_TagIsShown() then
  21.       HideTag()
  22.     end if
  23.   end if
  24. end
  25.  
  26. on RestoreHilites
  27.   set theVec to Get_SeenINPath()
  28.   repeat with i = 1 to the number of items in theVec
  29.     if item i of theVec = 1 then
  30.       set NumOfBox to i
  31.       set tagVLoc to ((NumOfBox - 1) * get_BoxSize()) + get_GridRef(2)
  32.       set the locH of sprite Get_HLSprite() to integer(get_GridRef(1))
  33.       set the locV of sprite Get_HLSprite() to integer(tagVLoc)
  34.       updateStage()
  35.     end if
  36.   end repeat
  37. end
  38.  
  39. on ChooseScreen
  40.   set themouseV to the mouseV
  41.   set NumOfBox to integer(((themouseV - get_GridRef(2)) / get_BoxSize()) - 0.5) + 1
  42.   set tagVLoc to ((NumOfBox - 1) * get_BoxSize()) + get_GridRef(2)
  43.   set the locH of sprite Get_HLSprite() to integer(get_GridRef(1))
  44.   set the locV of sprite Get_HLSprite() to integer(tagVLoc)
  45.   SaveHilite(NumOfBox)
  46.   set movieName to item NumOfBox of Get_CurrentSnakeScreens()
  47.   go("INIT" & Get_ScreenSubject(), movieName & ".GEO")
  48.   updateStage()
  49. end
  50.  
  51. on SaveHilite NumOfBox
  52.   Set_SeenINPath(1, Get_CDcounter())
  53. end
  54.  
  55. on ShowTag
  56.   set themouseV to the mouseV
  57.   set NumOfBox to integer(((themouseV - get_GridRef(2)) / get_BoxSize()) - 0.5) + 1
  58.   if get_LastTag() <> NumOfBox then
  59.     Set_LastTag(NumOfBox)
  60.     set tagVLoc to ((NumOfBox - 1) * get_BoxSize()) + get_GridRef(2) + integer(get_BoxSize() / 2)
  61.     set the castNum of sprite Get_TagSprite() to the number of cast ("tag-" & NumOfBox)
  62.     set the locH of sprite Get_TagSprite() to integer(get_GridRef(1)) - 3
  63.     set the locV of sprite Get_TagSprite() to integer(tagVLoc)
  64.     updateStage()
  65.     Set_TagIsShown(1)
  66.   end if
  67. end
  68.  
  69. on HideTag
  70.   Set_TagIsShown(0)
  71.   Set_LastTag(0)
  72.   set the locH of sprite Get_TagSprite() to 999
  73.   set the locV of sprite Get_TagSprite() to 999
  74.   updateStage()
  75. end
  76.  
  77. on SetGridRef
  78.   global GridRef
  79.   put the locH of sprite Get_SnakeSprite() into item 1 of GridRef
  80.   put the locV of sprite Get_SnakeSprite() into item 2 of GridRef
  81. end
  82.  
  83. on get_GridRef theItem
  84.   global GridRef
  85.   return item theItem of GridRef
  86. end
  87.  
  88. on Set_TagIsShown theSp
  89.   global TagIsShown
  90.   set TagIsShown to theSp
  91. end
  92.  
  93. on get_TagIsShown
  94.   global TagIsShown
  95.   return TagIsShown
  96. end
  97.  
  98. on Set_LastTag theSp
  99.   global LastTag
  100.   set LastTag to theSp
  101. end
  102.  
  103. on get_LastTag
  104.   global LastTag
  105.   return LastTag
  106. end
  107.  
  108. on Set_BoxSize theSp
  109.   global BoxSize
  110.   set BoxSize to theSp
  111. end
  112.  
  113. on get_BoxSize
  114.   global BoxSize
  115.   return BoxSize
  116. end
  117.  
  118. on Set_SnakeSprite theSp
  119.   global SnakeSprite
  120.   set SnakeSprite to theSp
  121. end
  122.  
  123. on Get_SnakeSprite
  124.   global SnakeSprite
  125.   return SnakeSprite
  126. end
  127.  
  128. on Set_HLSprite theSp
  129.   global HLSprite
  130.   set HLSprite to theSp
  131. end
  132.  
  133. on Get_HLSprite
  134.   global HLSprite
  135.   return HLSprite
  136. end
  137.  
  138. on Set_TagSprite theSp
  139.   global TagSprite
  140.   set TagSprite to theSp
  141. end
  142.  
  143. on Get_TagSprite
  144.   global TagSprite
  145.   return TagSprite
  146. end
  147.  
  148. on Set_CDcounter theNum
  149.   global CDcounter
  150.   set CDcounter to theNum
  151. end
  152.  
  153. on Add_CDcounter theNum
  154.   global CDcounter
  155.   set CDcounter to theNum + CDcounter
  156. end
  157.  
  158. on Get_CDcounter
  159.   global CDcounter
  160.   return CDcounter
  161. end
  162.  
  163. on Set_SeenINPath theNum, theItem
  164.   global SEENINPath
  165.   if paramCount() = 2 then
  166.     put theNum into item theItem of SEENINPath
  167.   else
  168.     set SEENINPath to theNum
  169.   end if
  170. end
  171.  
  172. on Get_SeenINPath theItem
  173.   global SEENINPath
  174.   if paramCount() = 1 then
  175.     return item theItem of SEENINPath
  176.   else
  177.     return SEENINPath
  178.   end if
  179. end
  180.  
  181. on SaveSeenScreens
  182.   SaveHilite()
  183.   set toolNum to Get_CurrentTool()
  184.   set theSub to integer(Get_ScreenSubject()) + 1
  185.   do("Set_WasInPathTool" & toolNum && theSub)
  186. end
  187.  
  188. on Set_ScreensTool01 theMode
  189.   global ScreensTool01
  190.   set ScreensTool01 to theMode
  191. end
  192.  
  193. on Get_ScreensTool01
  194.   global ScreensTool01
  195.   return ScreensTool01
  196. end
  197.  
  198. on Set_ScreensTool02 theMode
  199.   global ScreensTool02
  200.   set ScreensTool02 to theMode
  201. end
  202.  
  203. on Get_ScreensTool02
  204.   global ScreensTool02
  205.   return ScreensTool02
  206. end
  207.  
  208. on Set_ScreensTool03 theMode
  209.   global ScreensTool03
  210.   set ScreensTool03 to theMode
  211. end
  212.  
  213. on Get_ScreensTool03
  214.   global ScreensTool03
  215.   return ScreensTool03
  216. end
  217.  
  218. on Set_ScreensTool04 theMode
  219.   global ScreensTool04
  220.   set ScreensTool04 to theMode
  221. end
  222.  
  223. on Get_ScreensTool04
  224.   global ScreensTool04
  225.   return ScreensTool04
  226. end
  227.  
  228. on Set_ScreensTool05 theMode
  229.   global ScreensTool05
  230.   set ScreensTool05 to theMode
  231. end
  232.  
  233. on Get_ScreensTool05
  234.   global ScreensTool05
  235.   return ScreensTool05
  236. end
  237.  
  238. on Set_ScreensTool06 theMode
  239.   global ScreensTool06
  240.   set ScreensTool06 to theMode
  241. end
  242.  
  243. on Get_ScreensTool06
  244.   global ScreensTool06
  245.   return ScreensTool06
  246. end
  247.  
  248. on Set_WasInPathTool01 theMode
  249.   global WasInPathTool01
  250.   set WasInPathTool01 to theMode
  251. end
  252.  
  253. on Get_WasInPathTool01
  254.   global WasInPathTool01
  255.   return WasInPathTool01
  256. end
  257.  
  258. on Set_WasInPathTool02 theMode
  259.   global WasInPathTool02
  260.   set WasInPathTool02 to theMode
  261. end
  262.  
  263. on Get_WasInPathTool02
  264.   global WasInPathTool02
  265.   return WasInPathTool02
  266. end
  267.  
  268. on Set_WasInPathTool03 theMode
  269.   global WasInPathTool03
  270.   set WasInPathTool03 to theMode
  271. end
  272.  
  273. on Get_WasInPathTool03
  274.   global WasInPathTool03
  275.   return WasInPathTool03
  276. end
  277.  
  278. on Set_WasInPathTool04 theMode
  279.   global WasInPathTool04
  280.   set WasInPathTool04 to theMode
  281. end
  282.  
  283. on Get_WasInPathTool04
  284.   global WasInPathTool04
  285.   return WasInPathTool04
  286. end
  287.  
  288. on Set_WasInPathTool05 theMode
  289.   global WasInPathTool05
  290.   set WasInPathTool05 to theMode
  291. end
  292.  
  293. on Get_WasInPathTool05
  294.   global WasInPathTool05
  295.   return WasInPathTool05
  296. end
  297.  
  298. on Set_WasInPathTool06 theMode
  299.   global WasInPathTool06
  300.   set WasInPathTool06 to theMode
  301. end
  302.  
  303. on Get_WasInPathTool06
  304.   global WasInPathTool06
  305.   return WasInPathTool06
  306. end
  307.  
  308. on Set_WasInPathTool07 theMode
  309.   global WasInPathTool07
  310.   set WasInPathTool07 to theMode
  311. end
  312.  
  313. on Get_WasInPathTool07
  314.   global WasInPathTool07
  315.   return WasInPathTool07
  316. end
  317.  
  318. on Set_WasInPathTool08 theMode
  319.   global WasInPathTool08
  320.   set WasInPathTool08 to theMode
  321. end
  322.  
  323. on Get_WasInPathTool08
  324.   global WasInPathTool08
  325.   return WasInPathTool08
  326. end
  327.  
  328. on Set_WasInPathTool09 theMode
  329.   global WasInPathTool09
  330.   set WasInPathTool09 to theMode
  331. end
  332.  
  333. on Get_WasInPathTool09
  334.   global WasInPathTool09
  335.   return WasInPathTool09
  336. end
  337.  
  338. on Set_WasInPathTool10 theMode
  339.   global WasInPathTool10
  340.   set WasInPathTool10 to theMode
  341. end
  342.  
  343. on Get_WasInPathTool10
  344.   global WasInPathTool10
  345.   return WasInPathTool10
  346. end
  347.  
  348. on Set_WasInPathTool11 theMode
  349.   global WasInPathTool11
  350.   set WasInPathTool11 to theMode
  351. end
  352.  
  353. on Get_WasInPathTool11
  354.   global WasInPathTool11
  355.   return WasInPathTool11
  356. end
  357.  
  358. on Set_WasInPathTool12 theMode
  359.   global WasInPathTool12
  360.   set WasInPathTool12 to theMode
  361. end
  362.  
  363. on Get_WasInPathTool12
  364.   global WasInPathTool12
  365.   return WasInPathTool12
  366. end
  367.  
  368. on Set_WasInPathTool13 theMode
  369.   global WasInPathTool13
  370.   set WasInPathTool13 to theMode
  371. end
  372.  
  373. on Get_WasInPathTool13
  374.   global WasInPathTool13
  375.   return WasInPathTool13
  376. end
  377.  
  378. on Set_CurrentTool theMode
  379.   global CurrentTool
  380.   set CurrentTool to theMode
  381. end
  382.  
  383. on Get_CurrentTool
  384.   global CurrentTool
  385.   return CurrentTool
  386. end
  387.  
  388. on Set_CurrentSnakeScreens theMode
  389.   global CurrentSnakeScreens
  390.   set CurrentSnakeScreens to theMode
  391. end
  392.  
  393. on Get_CurrentSnakeScreens
  394.   global CurrentSnakeScreens
  395.   return CurrentSnakeScreens
  396. end
  397.